package base;

public class MethodDemo {

    public static void main(String[] args) {

        int[] arrayName = {3,6,8};

        int max = getArrayMaxValue(arrayName);

        System.out.println(max);
    }

    private static int getArrayMaxValue(int[] arrayName) {


        if (arrayName == null || arrayName.length == 0)
            return -1;

        int max = arrayName[0];
        for (int i = 0; i < arrayName.length; ++i) {
            if (arrayName[i] > max) {

                max = arrayName[i];
            }
        }


        return max;
    }


}

